Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Upgrade to Next.js 15 #762

Merged
merged 7 commits into from
Oct 31, 2024
Merged

[docs] Upgrade to Next.js 15 #762

merged 7 commits into from
Oct 31, 2024

Conversation

vladmoroz
Copy link
Contributor

@vladmoroz vladmoroz commented Oct 25, 2024

Upgrade to Next.js 15, mainly for the TypeScript config.

Since we are going to use built-in @next/mdx features that are configured through the Next.js config, we need this in order to use rehype/remark plugins written in TypeScript.

Edit: forget this, next.config.ts module resolution is CJS only, and all rehype/remark ecosystem is ESM


I also briefly tried enabling Turbopack, but it doesn't work with the current demos which rely on Webpack to dynamically load the components. I'll migrate to Turbopack when we don't do the dynamic Webpack import anywhere.

@vladmoroz vladmoroz added the docs Improvements or additions to the documentation label Oct 25, 2024
Comment on lines +73 to +79
"@types/react": "npm:[email protected]",
"@types/react-dom": "npm:[email protected]",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comes from their codemod

Comment on lines +46 to +52
"react": "19.0.0-rc-69d4b800-20241021",
"react-dom": "19.0.0-rc-69d4b800-20241021",
"react-error-boundary": "^4.0.13",
"react-is": "^18.3.1",
"react-is": "19.0.0-rc-69d4b800-20241021",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comes from their codemod

Comment on lines 1 to 4
export const shikiTheme = {
light: 'github-light-default',
dark: 'material-theme-ocean',
};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Next.js was complaining about exporting a config from the project root, seems like this used to be some pattern that is now deprecated

For context, this file will go completely when I'm done with code blocks updates

@mui-bot
Copy link

mui-bot commented Oct 25, 2024

Netlify deploy preview

https://deploy-preview-762--base-ui.netlify.app/

Generated by 🚫 dangerJS against e7c0a89

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Oct 28, 2024
@michaldudak
Copy link
Member

I have a feeling that making the regression tests pass will require upgrading React in all our packages, including test and Base UI.

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Oct 30, 2024
@vladmoroz
Copy link
Contributor Author

vladmoroz commented Oct 30, 2024

I have a feeling that making the regression tests pass will require upgrading React in all our packages, including test and Base UI.

@michaldudak upgraded to React 19 everywhere and the regression tests now pass

Should I worry about this?

Edit: never mind, it passes after the rebase

image

Running pnpm proptypes locally doesn't produce any changes

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Oct 30, 2024
@github-actions github-actions bot added PR: out-of-date The pull request has merge conflicts and can't be merged and removed PR: out-of-date The pull request has merge conflicts and can't be merged labels Oct 31, 2024
@michaldudak
Copy link
Member

We can disable the static route indicator (https://nextjs.org/docs/app/api-reference/next-config-js/devIndicators#appisrstatus-static-indicator). All our routes are prerendered at build time, so it doesn't add any value.

@michaldudak
Copy link
Member

I configured the CI to also run tests against React 18, as 19 won't be widely adopted yet

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Oct 31, 2024
@vladmoroz
Copy link
Contributor Author

We can disable the static route indicator (https://nextjs.org/docs/app/api-reference/next-config-js/devIndicators#appisrstatus-static-indicator). All our routes are prerendered at build time, so it doesn't add any value.

@michaldudak nice, updated. Good to merge?

@vladmoroz vladmoroz merged commit 891e7c2 into mui:master Oct 31, 2024
22 checks passed
@vladmoroz vladmoroz deleted the nextjs-15 branch October 31, 2024 17:22
@michaldudak
Copy link
Member

michaldudak commented Nov 1, 2024

FYI, ESM support in next.config.ts is coming: vercel/next.js#68365

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants